<!DOCTYPE HTML>
<html>
<head>
	<meta charset="UTF-8">
	<title>获取URL参数</title>
	<link rel="stylesheet" type="text/css" href="../../style/public.css">
</head>
<body>
	<p>获取URL参数</p>

</body>
	<script>
	/*获取URL参数*/
	function GetSearch(){
		/*取得查询字符串并去掉开头？号*/
		var qs = (location.search.length > 0 ? location.search.substring(1) : '');
		/*保存数据的对象*/
		var args = {};
		/*取得每一项*/
		var items = qs.split('&');
		var item = null,
			name = null,
			value = null;
		/*添加到到args*/
		for(var i=0; i<items.length;i++){
			item = items[i].split('=');
			name = decodeURIComponent(item[0]);
			value = decodeURIComponent(item[1]);
			args[name] = value;
		}
		return args;
	}
	console.log(GetSearch()['menu'])
	</script>
</html>